/************************* 版权声明 *********************************
 * 
 * 版权所有：Apache License 2.0
 * 
 ************************* 版本声明 *********************************
 *@since jdk1.5
 *@version 0.1
 ************************* 变更记录 *********************************
 *
 * 创建者：bijiqiang Email:bijiqiang@gmail.com   创建日期： 2009-12-17
 * 创建记录：创建类结构。
 * 
 * 修改者：       修改日期：
 * 修改记录：
 *
 * 修改者：       修改日期：
 * 修改记录：
 * ……
 ************************* To  Do *********************************
 *
 * 1、实现所有未实现的方法（抛出UnsupportedOperationException的方法）。
 * 
 ************************* 随   笔 *********************************
 *
 * 
 * 
 ******************************************************************
 */

package com.realgodo.site.entity.application.show;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.realgodo.site.entity.application.Application;

@Entity(name = "Show")
@Table(name = "show_table")
@Inheritance(strategy = InheritanceType.JOINED)
@PrimaryKeyJoinColumn(name = "id", referencedColumnName = "id")
public class Show extends Application {
	private static final long serialVersionUID = -9047473406052686652L;

	private String title;

	private String content;

	private String cover;

	private String description;

	/** 显示模式 0-标准模式 1-幻灯片模式 */
	private int display;

	/** 隐私设置 0-公开 1-会员可见 2-朋友可见 3-隐藏 */
	private int privacy;

	public static final int PRIVACY_ALL = -1;
	public static final int PRIVACY_PUBLIC = 0;
	public static final int PRIVACY_MEMBER = 1;
	public static final int RRIVACY_FRIEND = 2;
	public static final int PRIVACY_HIDDEN = 3;

	/** 展示类型 0-我自己 1-我的作品 2-活动事件 3-转载 */
	private int type;

	private Date showTime;
	/** 代表展示0 no;1-yes */
	private int best = 0;

	/** 置顶展示0 no ;1-yes */
	private int myTop = 0;

	private ShowCatalog showCatalog;

	private List<ShowModule> showModules = new ArrayList<ShowModule>();

	private int top = 0;
	public static final int TOP_ALL = -1;
	public static final int TOP_NOT = 0;
	public static final int TOP_YES = 1;

	private int viedo = 0;

	public static final int VIEDO_ALL = -1;
	public static final int VIEDO_NOT = 0;
	public static final int VIEDO_YES = 1;

	private int viedoTop = 0;

	public static final int VIEDO_TOP_ALL = -1;
	public static final int VIEDO_TOP_NO = 0;
	public static final int VIEDO_TOP_YES = 1;

	private Long hit = 0L;
	private Long favoriteCount = 0L;

	/** transient filed Show.title||Show.space.name */
	private String key;

	/** transient filed ShowCatalog.id */
	private Long sid;

	@Column(name = "title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Lob
	@Basic(fetch = FetchType.LAZY)
	@Column(name = "content", insertable = true, updatable = true)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "cover")
	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	@Column(name = "display", length = 11)
	public int getDisplay() {
		return display;
	}

	public void setDisplay(int display) {
		this.display = display;
	}

	@Column(name = "privacy", length = 11)
	public int getPrivacy() {
		return privacy;
	}

	public void setPrivacy(int privacy) {
		this.privacy = privacy;
	}

	@Column(name = "type", length = 11)
	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@ManyToOne
	@JoinColumn(name = "show_catalog_id", referencedColumnName = "id", nullable = true)
	public ShowCatalog getShowCatalog() {
		return showCatalog;
	}

	public void setShowCatalog(ShowCatalog showCatalog) {
		this.showCatalog = showCatalog;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "show_time")
	public Date getShowTime() {
		return showTime;
	}

	public void setShowTime(Date showTime) {
		this.showTime = showTime;
	}

	@Column(name = "top")
	public int getTop() {
		return top;
	}

	public void setTop(int top) {
		this.top = top;
	}

	@Column(name = "hit")
	public Long getHit() {
		return hit;
	}

	public void setHit(Long hit) {
		this.hit = hit;
	}

	@Column(name = "best")
	public int getBest() {
		return best;
	}

	public void setBest(int best) {
		this.best = best;
	}

	@Column(name = "my_top")
	public int getMyTop() {
		return myTop;
	}

	public void setMyTop(int myTop) {
		this.myTop = myTop;
	}

	@Column(name = "description", length = 1000)
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "favorite_count", length = 1000)
	public Long getFavoriteCount() {
		return favoriteCount;
	}

	public void setFavoriteCount(Long favoriteCount) {
		this.favoriteCount = favoriteCount;
	}

	@Column(name = "viedo_top")
	public int getViedoTop() {
		return viedoTop;
	}

	public void setViedoTop(int viedoTop) {
		this.viedoTop = viedoTop;
	}

	public int getViedo() {
		return viedo;
	}

	public void setViedo(int viedo) {
		this.viedo = viedo;
	}

	@Transient
	public Long getSid() {
		return sid;
	}

	public void setSid(Long sid) {
		this.sid = sid;
	}

	@Transient
	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Transient
	public List<ShowModule> getShowModules() {
		return showModules;
	}

	public void setShowModules(List<ShowModule> showModules) {
		this.showModules = showModules;
	}
}
